package com.mabang.medata.procotol;

import com.mabang.medata.model.BillNoResponse;

/**
 * 	
* @ClassName: BillProcotol 
* @Description: 保险单号反写
* @author yuyidi 
* @date 2015年4月2日 上午9:22:24
 */
public class BillProcotol {
	/**
	 * 
	* @Title: billQuote 
	* @Description: 传入保单号，报价单号
	* @Param
	* @return String
	* @throws
	 */
	public static String billQuote(String billNo,String quoteNo){
		StringBuffer buffer = new StringBuffer();
		buffer.append("<proposal valid=\"true\">");
		buffer.append("<bill-no>#billno#</bill-no>");//报价单号
		buffer.append("<quote-no>#quoteno#</quote-no>");//报价单号
		buffer.append("</proposal>");
		String result = buffer.toString();
		result = result.replace("#billno#", billNo);
		result = result.replace("#quoteno#", quoteNo);
		return result;
	}
	
	/**
	 * 
	* @Title: responseBillQuote 
	* @Description: 返回保单反写成功状态
	* @Param
	* @return String
	* @throws
	 */
	public static String responseBillQuote(BillNoResponse bnr){
		StringBuffer buffer = new StringBuffer();
		buffer.append("<new-quote-return-result  status=\"#status#\">");
		buffer.append("<bill-no>#billNo#</bill-no>");
		buffer.append("<quote-no>#quoteNo#</quote-no>");
		buffer.append("<trans-date>#transDate#</trans-date>");
		buffer.append("<message>#message#</message>");
		buffer.append("</new-quote-return-result>");
		String result = buffer.toString();
		result=result.replace("#status#", bnr.getStatus());
		result=result.replace("#billNo#", bnr.getBillNo());
		result=result.replace("#quoteNo#", bnr.getQuoteNo());
		result=result.replace("#transDate#", bnr.getTransDate());
		result=result.replace("#message#", bnr.getMessage());
		return result;
	}
}
